<!DOCTYPE html>
<head>
<?php include_once VIEWS.'inc/head.php'; ?>
</head>

<body>
	<div id="back-top"></div>
    <?php include_once VIEWS.'inc/header.php'; ?>
<?php include_once VIEWS.'inc/right.php'; ?>

	
	<div class="w1680 jobs-banner shadow2">
	<img src="<?php echo UPLOAD_URL.tag_photo(tag_single(20,"photo"));?>">
	</div>

	<div class="w1680 service-first shadow bc">
		<div class="w1190 service-top">
			<div class="fl service-top-left">
				<div class="en-title">RECRUITMENT</div>
				<div class="ch-title">人才招聘</div>
			</div>
		</div>
	</div>
	
	<div class="w1680 jobs-second shadow js-ajax-box">
	
	<?php if(!empty($fenye['new_con'])):?>
  <?php foreach($fenye['new_con'] as $k=>$v):?>
		<div class="w1190 jobs-frame">
			<div class="jobs-title"><?php echo $v['title'];?></div>
			<div class="jobs-simple">
				<?php echo msubstr(str_replace('&nbsp;','',trim(strip_tags($v['content']))),0,80);?>
				<div class="jobs-more"></div>
			</div>
			<div class="jobs-detail">
				<div class="jobs-d-title">
					<div class="fl d-title-f">工作地址：<span><?php echo $v['dz'];?></span></div>
					<div class="fl d-title-f">人数：<span><?php echo $v['mans'];?></span></div>
					<div class="fr d-title-f2">工作年限：<span><?php echo $v['years'];?></span></div>
				</div>
				<div class="jobs-text">
					<?php echo $v['content'];?>
				</div>
				<div class="jobs-less"></div>
				<a href="<?php echo site_url('jobs/apply/'.$v['id']);?>"><div class="resume">投递简历</div></a>
			</div>
		</div>
		<?php endforeach;?>
  	<?php endif;?>

		<div class="loading"></div>
		
	</div>

    <?php include_once VIEWS.'inc/footer.php'; ?>
<?php
	echo static_file('web/js/main.js');
?>
</body>
</html>
<script type="text/javascript">
$(function(){
	
    $(".jobs-frame").find(".jobs-simple .jobs-more").click(function(){
    	var js=$(this).parent('.jobs-simple');
    	var jd=$(this).parents('.jobs-frame').find('.jobs-detail');
		js.hide();
		jd.show();
	});
	

	$(".jobs-frame").find(".jobs-detail .jobs-less").click(function(){
    	var jd=$(this).parent('.jobs-detail');
    	var js=$(this).parents('.jobs-frame').find('.jobs-simple');
		jd.hide();
		js.show();
	});
	
	var NewUrl = '<?php echo site_url('jobs/job_ajax');?>';
	var p = 1;
	$(window).scroll(function(){
		if ($(document).height() - $(this).scrollTop() - $(this).height()<1){
		//if($(document).scrollTop()>=$(document).height()-$(window).height()-180){
		    $.ajax({
		        type:"GET",
		        url:NewUrl,
		        data: { page: p+1},
	          cache: false,
		        dataType:'json',
		        beforeSend:function(){
		          $('.loading').show(); //显示加载时候的提示
		        },
		        success:function(data){
		        			 if(data.status=='yes'){
                    p=p+1;
                   }else{
                	   $(window).off("scroll");
                	   $('.loading').hide();//请求成功,隐藏加载提示
                   }
		        	$('.js-ajax-box').append(data.list);
		        }
		    })
	  	}
	});


})

</script>